链表翻转3
//循环头插法
struct ListNode* reverseList(struct ListNode* head) {
    if (!head)
        return NULL;
    if (!(head->next))
        return head;
    struct ListNode* prev = NULL;
    struct ListNode* next = NULL;
    struct ListNode* cur = head;

    while (cur)
    {
        next = cur->next;
        cur->next = prev;
        prev = cur;
        cur = next;
    }
    return prev;
}
